package com.youlu.campus.web.qa;

import com.youlu.campus.entity.VO.req.UserDoQaVO;
import com.youlu.campus.service.qa.UserQaAnswerLogService;
import com.youlu.campus.web.common.base.RequestContext;
import com.yuelin.infrastructure.quantum.common.QResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ActivityQaController {

    @Autowired
    private UserQaAnswerLogService userQaAnswerLogService;
    /**
     * 提交答题
     *
     * @param req
     * @return
     */
    @PostMapping("/mini-app/activity/todo")
    public QResult doQa(@RequestBody UserDoQaVO req) {
        req.setUserId(RequestContext.getUserId());
        req.setUserPO(RequestContext.getCurUser());
        return QResult.success(req);
    }

    @GetMapping("/public/qa/log")
    public QResult userQaLogExport(String activityId){
        userQaAnswerLogService.userQaLogExport(activityId);
        return QResult.success(null);
    }

}
